import { Flag } from 'lucide-react'

interface PriorityLabelProps {
  priority: string
  className?: string
}

function PriorityLabel({ priority, className = '' }: PriorityLabelProps) {
  const getPriorityColor = (priority: string) => {
    switch (priority) {
      case 'P0': 
        return 'bg-red-100 text-red-700 border-red-200'
      case 'P1': 
        return 'bg-orange-100 text-orange-700 border-orange-200'
      case 'P2': 
        return 'bg-yellow-100 text-yellow-700 border-yellow-200'
      case 'P3': 
        return 'bg-green-100 text-green-800 border-green-200'
      default: 
        return 'bg-slate-100 text-slate-600 border-slate-200'
    }
  }

  return (
    <div className={`flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium border ${
      getPriorityColor(priority)
    } ${className}`}>
      <Flag size={12} />
      <span>{priority}</span>
    </div>
  )
}

export default PriorityLabel
